import request from '@/utils/request'
import { paramNoNull } from '@/utils/ParamFilter'

export function page(data) {
  return request({
    url: '/admin/bee-manage/sys-department/page',
    method: 'get',
    params: paramNoNull(data)
  })
}
export function deleteById(id) {
  return request({
    url: '/admin/bee-manage/sys-department/' + id,
    method: 'delete'
  })
}

export function deleteByIds(ids) {
  return request({
    url: '/admin/bee-manage/sys-department/batch',
    method: 'post',
    data: ids
  })
}

export function recover(ids) {
  return request({
    url: '/admin/bee-manage/sys-department/recover',
    method: 'post',
    data: ids
  })
}

export function editDepartment(data) {
  return request({
    url: '/admin/bee-manage/sys-department/edit',
    method: 'post',
    data: paramNoNull(data)
  })
}
export function addDepartment(data) {
  return request({
    url: '/admin/bee-manage/sys-department',
    method: 'post',
    data: paramNoNull(data)
  })
}

export function clear() {
  return request({
    url: '/admin/bee-manage/sys-department/clear',
    method: 'delete'
  })
}
